from server_send_and_receive_test import *
from game import *
from player import *
from time import sleep

g=Game()
pipe=ServerPipe("",12345)
pipe.startConnection()
print g.state
while len(g.playerList)<2:
    g.stateStep()
    if pipe.connections.qsize>0:
        con=pipe.connections.get()
        player=Player()
        player.setConnection(con)
        g.playerList.append(player)

while True:
    print g.state
    #Will have a list of games
    g.stateStep()
    sleep(1)

